package PAPForLargeOntologies;

import java.io.File;
import java.util.ArrayList;

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;

public class ReadOntology {
	public static void main(String[] args) {
		//LER AS ONTOLOGIAS
//		ReadOntology reader = new ReadOntology();
//		try {
////			OWLOntology onto = reader.readOWL("src/ontologies/agrovoc_oaei2007.owl");
//			OWLOntology onto = reader.readOWL("src/ontologies/asfa_oaei2008.owl");
//			ArrayList<PAPClass> listClass = new ArrayList<PAPClass>();
//			for (OWLClass owlClass : onto.getClassesInSignature()) {
////				listClass.add(new PAPClass(ReaderRDF.getLabel(owlClass, onto), owlClass));
//				System.out.println(ReaderRDF.getLabel(owlClass, onto, true));
//			}
//			
//		} catch (OWLOntologyCreationException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
		
		
		//TRABALHAR COM O ALINHAMENTO
		//Compare results
		ArrayList<String> alignReferece = null;
		String ALIGNMENT_OF_REFERENCE = "src/ontologies/FMA2NCI.owl";
		alignReferece = ReaderRDF.alignmentWithTypeOWL(ALIGNMENT_OF_REFERENCE);
	}
	
	/**
	 * Method to read owl file.
	 * @param path
	 * @return OWL Ontology
	 * @throws OWLOntologyCreationException
	 */
	private OWLOntology readOWL(String path) throws OWLOntologyCreationException {
		String DOCUMENT_IRI = path;
		File file = new File(DOCUMENT_IRI);
		// Create our ontology manager in the usual way.
		OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
		// Load a copy of the people+pets ontology. We'll load the ontology from
		// the web (it's acutally located in the TONES ontology repository).
		IRI docIRI = IRI.create(file);
		// We load the ontology from a document - our IRI points to it directly
		OWLOntology ontology = manager.loadOntologyFromOntologyDocument(docIRI);
		
		return ontology;
	}

}
